package fr.anime.controller;

import javax.swing.JSplitPane;

import fr.anime.model.Model;
import fr.anime.view.FilesView;
import fr.anime.view.HistoricView;
import fr.anime.view.InfoView;
import fr.anime.view.MainView;

public class MainViewController extends Controller {
	Model model;
	MainView view;
	
	public MainViewController(Model model, MainView view) {
		this.model = model;
		this.view = view;
		
		createGUI();
	}

	private void createGUI() {
		// TODO Auto-generated method stub
		FilesView filesView = new FilesView();
		Controller filesViewController = new FilesViewController(filesView, model);
		System.out.println("coucou 3");

		HistoricView historicView = new HistoricView();
		InfoView infoView = new InfoView();

		JSplitPane splitter1 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, infoView, historicView);
		splitter1.setDividerLocation(400);
		JSplitPane splitter2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, filesView, splitter1);
		splitter2.setDividerLocation(400);

		view.setContentPane(splitter2);
		view.repaint();
		view.setVisible(true);
	}
}
